import { PageLoading } from '@ant-design/pro-layout';
import { history, Link } from 'umi';
const loginPath = '/user/login';
/** 获取用户信息比较慢的时候会展示一个 loading */

export const initialStateConfig = {
  loading: <PageLoading />,
};
/**
 * @see  https://umijs.org/zh-CN/plugins/plugin-initial-state
 * */

export async function getInitialState() {
  // const currentUser = await getFetch({ url: '/vehicle-api/user/info' });
  // if (!currentUser) {
  //   history.replace(loginPath);
  // }
  return {
    //   currentUser: currentUser.data ?? {},
  };
}
